import { request as http } from "./request";

export interface ApifoxModel {
  /**
   * 响应数据
   */
  data: Data;
  /**
   * 响应消息
   */
  message: string;
  [property: string]: any;
}

/**
* 响应数据
*/
export interface Data {
  /**
   * refresh_token字符串，用于刷新token使用
   */
  refresh_token: string;
  /**
   * token字符串
   */
  token: string;
  [property: string]: any;
}

export interface Params {
  mobile: string
  code: string
}

export const getLoginApi = (data: Params) => {
  return http.request<ApifoxModel>({
    method: 'post',
    url: `/authorizations`,
    data
  })
}